<div ng-controller="GroupAddCtrl">
    <div>
        <script type="text/ng-template" id="nodes_renderer.html">
            <div ui-tree-handle class="tree-node tree-node-content">
                <add-node-info node-value="node" node-type="'edit'"></add-node-info>
            </div>
        </script>
        <script type="text/ng-template" id="list_renderer.html">
            <div ui-tree-handle class="tree-node tree-node-content">
                <a class="pull-right btn btn-white btn-xs" data-nodrag ng-click="removeSubNode(subNode)"><span class="fa fa-trash"></span></a>
            </div>
            <ol ui-tree-nodes ng-model="subNode.data">
                <li ng-repeat="node in subNode.data" ui-tree-node ng-include="'nodes_renderer.html'"></li>
            </ol>
        </script>
        <div ng-if="field.type.data" ui-tree id="tree-root">
            <ol ui-tree-nodes ng-model="field.type.data">
                <li ng-repeat="node in field.type.data" ui-tree-node ng-include="'nodes_renderer.html'"></li>
            </ol>
        </div>
        <div ng-if="!field.type.data">
            <add-node-info node-value="field" node-type="'edit'"></add-node-info>
        </div>
        <form class="col-lg-12" ng-submit="saveChanges()">
            <button type="submit" class="btn btn-primary btn-sm btn-block" ><i class="fa fa-save"></i> Save Your Changes</button>
            <div ng-show="loading" class="sk-spinner sk-spinner-double-bounce">
                <div class="sk-double-bounce1"></div>
                <div class="sk-double-bounce2"></div>
            </div>
        </form>

    </div>
</div>